<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:81:"D:\phpstudy\PHPTutorial\WWW\farm\farm_sink/application/index\view\xinxi\laji.html";i:1556349004;s:82:"D:\phpstudy\PHPTutorial\WWW\farm\farm_sink/application/index\view\common\head.html";i:1555643468;}*/ ?>
<!DOCTYPE html>
<html>
  
  <head>
    <meta charset="UTF-8">
    <title>农厂汇小程序管理中心</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi" />
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
    <link rel="stylesheet" href="__STATIC__/css/font.css"> 
	<link href="/favicon.ico" type="image/x-icon" rel="shortcut icon" /> 
    <link rel="stylesheet" href="__STATIC__/css/xadmin.css">
    <link href="__STATIC__/lib/layui/css/layui.css" rel="stylesheet">
    <script type="text/javascript" src="__STATIC__/js/jquery.min.js"></script>
    <script type="text/javascript" src="__STATIC__/lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="__STATIC__/js/xadmin.js"></script>
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
      <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
      <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <script type="text/css">
      #fff{
        border: red solid 1px;
      }
    </script>
  </head>
  
<body>
<div class="x-nav">
      <span class="layui-breadcrumb">
        <a href="">首页</a>
        <a href="">演示</a>
        <a>
          <cite>垃圾信息</cite></a>
      </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" href="javascript:location.replace(location.href);" title="刷新">
        <i class="layui-icon" style="line-height:30px">ဂ</i></a>
</div>
<div class="x-body">
    <form class="layui-form" action="">
    <table class="layui-table">
        <thead>
        <tr style="text-align: center">
            <th>NO</th>
            <th>信息ID</th>
            <th>类型</th>
            <th style="text-align: center">图片</th>
            <th style="text-align: center">标题(前12字)</th><!--显示12个字-->
            <th style="text-align: center">供应数量</th>
            <th>单位</th>
            <th style="text-align: center">价格</th>
            <th style="text-align: center">摘要(前20字)</th><!--前20个字-->
            <th>用户</th>
            <th style="text-align: center">认证状态</th>
            <th style="text-align: center">发布时间</th>
            <th style="text-align: center">锁定状态</th>
        </tr>
        </thead>
        <tbody>
        <?php if(is_array($rs) || $rs instanceof \think\Collection || $rs instanceof \think\Paginator): $i = 0; $__LIST__ = $rs;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$rs): $mod = ($i % 2 );++$i;?>
        <tr style="text-align: center">
            <td><?php echo $key+1; ?></td>
            <td><?php echo $rs['mid']; ?></td>
            <td><?php if($rs['type']==1): ?>产品<?php else: ?>文章<?php endif; ?></td>
            <td><?php if($rs['picture']==''): ?>
                <img src="/upload/message/no.jpg" width="50">
                <?php else: $str=$rs['picture'];
                        $a=explode(",",$str);?><img src="/upload/message/<?php echo $a['0']; ?>" width="50" height="50">
                <?php endif; ?></td>
            <td><?php echo mb_substr($rs['title'],0,12,'utf-8'); ?></td>
            <td><?php echo $rs['number']; ?></td>
            <td><?php if($rs['type']==2): elseif($rs['unit']==1): ?>吨<?php elseif($rs['unit']==2): ?>公斤<?php elseif($rs['unit']==3): ?>斤<?php else: ?>个<?php endif; ?></td>
            <td><?php if($rs['type']==2): elseif($rs['unit']==1): ?><?php echo $rs['price']; ?>元/吨<?php elseif($rs['unit']==2): ?><?php echo $rs['price']; ?>元/公斤<?php elseif($rs['unit']==3): ?><?php echo $rs['price']; ?>元/斤<?php else: ?><?php echo $rs['price']; ?>元/个<?php endif; ?></td>
            <td><?php echo mb_substr($rs['content'],0,20,'utf-8'); ?></td>
            <td><?php if($rs['uname']==''): ?><?php echo rawurldecode($rs['nickname']); else: ?><?php echo $rs['uname']; endif; ?></td>
            <td><?php if($rs['rflg']==1): ?>已认证<?php else: ?>未认证<?php endif; ?></td>
            <td><?php echo $rs['createtime']; ?></td>
            <td><input type="checkbox" <?php if ($rs['mflg'] ==0): ?>  checked="" <?php endif; ?> name="status[]" lay-skin="switch" lay-filter="switchSuodoing" lay-text="开启|关闭"/ value="<?php echo $rs['mid']; ?>"></td>
        </tr>
        <?php endforeach; endif; else: echo "" ;endif; ?>
        </tbody>
    </table>
    </form>
    <div class="page">
        <div>
            <?php echo $page; ?>
        </div>
    </div>

</div>
<script>
    layui.use(['laydate','form'], function() {
        var laydate = layui.laydate;
        var form = layui.form;
        //执行一个laydate实例
        form.on('switch(switchSuodoing)', function (data) {
            var id = data.value;
            //alert(111);
            $.ajax({
                url: "<?php echo url('index/xinxi/chexiaolahei'); ?>",
                type: "post",
                dataType: "JSON",
                data: {mid: id},
                success: function (res) {
                    if (res == 1) {
                        layer.msg('操作成功！');
                        setTimeout(function () {
                            location.reload();
                        }, 1000);
                        return false;
                    } else {
                        layer.msg('操作失败！');
                        /*setTimeout(function () {
                            location.reload();
                        }, 1000);*/
                        return false;
                    }
                }
            });
        });
    });

    /*用户-删除*/
    function member_del(obj,id){
        layer.confirm('确认要删除吗？',function(index){
            //发异步删除数据
            $(obj).parents("tr").remove();
            layer.msg('已删除!',{icon:1,time:1000});
        });
    }



    function delAll (argument) {

        var data = tableCheck.getData();

        layer.confirm('确认要删除吗？'+data,function(index){
            //捉到所有被选中的，发异步进行删除
            layer.msg('删除成功', {icon: 1});
            $(".layui-form-checked").not('.header').parents('tr').remove();
        });
    }
</script>

</body>

</html>